﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MediaManager
{
    public partial class DayInfoFrm : Form
    {
        private DayInfoFrm()
        {
            InitializeComponent();
        }
        public DayInfoFrm(string userName)
        {
            InitializeComponent();
            _userName = userName;
        }
        private string _userName = "";
        DataClasses2DataContext _dataContext = new DataClasses2DataContext();
        private void DayInfoFrm_Load(object sender, EventArgs e)
        {
            try
            {
                List<DayInfo> listDayInfo = new List<DayInfo>();
                listDayInfo = _dataContext.DayInfo.Where(p => p.name == _userName).ToList<DayInfo>();
                string ss = "";
                int t = 0;
                foreach (DayInfo dayInfo in listDayInfo)
                {
                    t++;
                    ss += t.ToString().Trim() + "， "  +  dayInfo.操作;
                }
                this.richTextBox1.Text = ss;
            }
            catch (Exception ex)
            {
                GlobalBase.CatchException.DealWithException(ex);
            }
        }
        
    }
    public struct StructDayInfo
    {
        public static string 登陆 = "登陆日期{0}\n";
        public static string 退出登陆 = "退出登陆,{0}\n";
        public static string 添加病例 = "添加病例{0}，添加日期{1}\n";
        public static string 删除病例 = "删除病例{0}，删除日期{1}\n";
        public static string 添加人员 = "添加登陆人员{0}，添加日期{1}\n";
        public static string 删除人员 = "删除登陆人员{0}，删除日期{1}\n";
    }
}
